<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>提示</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/H5/css/sm.min.css">
    <link rel="stylesheet" href="/H5/css/reset.css">
    <link rel="stylesheet" type="text/css" href="/H5/css/main.css?v=2"/>
</head>
<style>
    html {
        height: 100%;
    }

    body {
        height: 100%;
        padding: 0;
        margin: 0;
        max-width: 540px;
    }
    #tishi{
        width: 100%;
        height:100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f5f5f5;
    }
    .output {
        border: 1px solid #c7b7b7;
        width: 65%;
        border-radius: .3rem;
        padding: .5rem 1rem;
        background-color: rgba(255, 255, 255, 0.63);
    }

    p:first-of-type {
        border-bottom: 1px solid grey;
        padding-bottom: .2rem;
    }
</style>
<body>
<div class="page-group ms-controller" id="tishi" :controller="wxlogin">
    <div class="output">
        <p>温馨提示：</p>
        <p style="color: blue">正在登录</p>
    </div>
    <script>
        window.onload = function () {
           /* setTimeout(function () {
                window.location.href = 'http://www.baidu.com'
            }, 3000)*/

        }
    </script>
    <script type='text/javascript' src='/H5/js/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/H5/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/H5/js/avalon.js' charset='utf-8'></script>
    <script type='text/javascript' src='/H5/js/simpleStorage.js' charset='utf-8'></script>
    <!-- <script type='text/javascript' src='/H5/js/wx.js' charset='utf-8'></script> -->
    <!-- <script type='text/javascript' src='http://res2.wx.qq.com/open/js/jweixin-1.4.0.js' charset='utf-8'></script> -->
    <script type='text/javascript' src='/H5/js/mall-wx.js?v=11' charset='utf-8'></script>
</div>

<script>
    var WxLogin = avalon.define({
        $id: "wxlogin",
        openid: decodeURI(Mall.parseUrl(window.location.href).openid),
        data: {},
        getDetail: function( t ){
            Mall.request( "/api/WxLogin" ,{ openid: WxLogin.openid})
                    .always( function( data ){
                        if( data.error_code == 0 ){
                            simpleStorage.set("token", data.data.api_token);
                            simpleStorage.set("expire_time", data.data.expire_time*1000);
                            simpleStorage.set( "myInviteCode", Mall.parseUrl(window.location.href).invite_code);
                            window.location.href = '/';
                        }
                    } );
            $( ".content" ).removeClass( "visibility" )
        },
    });

    WxLogin.getDetail();
    avalon.scan( document.body );
</script>
</body>
</html>